
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>添加福利类型表单</title>
    <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css">
    <link rel="stylesheet" href="__PUBLIC__/static/css/style.css">
    <link rel="icon" href="__PUBLIC__/static/image/code.png">
</head>
<body class="body">

<form class="layui-form" action="" method="post" id="addform">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">类型名称</label>
            <div class="layui-input-inline">
                <input type="tel" name="name" lay-verify="required" autocomplete="off" placeholder="请输入标题" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
            <textarea placeholder="请输入备注" name="remark" class="layui-textarea"></textarea>
        </div>
    </div>
  <div class="layui-form-item">
    <label class="layui-form-label">类型</label>
    <div class="layui-input-block">
      <input type="radio" name="type" value="1" title="正常" checked="">
      <input type="radio" name="type" value="0" title="禁用">
    </div>
  </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
<!-- 通用-970*90 -->
<script src="__PUBLIC__/layui/layui.js" charset="utf-8"></script>
<script src="__ADMIN__/js/comm.js" charset="utf-8"></script>
<script>
    layui.use(['form','admin'], function(){
        var form = layui.form
                ,layer = layui.layer
                ,admin = layui.admin
                ,$ = layui.$ //重点处
//添加

        //监听指定开关
        form.on('submit(demo1)', function(data){
            admin.action("{:url('admin/WelfareType/add')}",$("#addform").serialize());
            return false;
        });

          //监听指定开关






    });
</script>
</body>
</html>